<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<head>
<base href="<%=basePath%>" />
<title>soda教育</title>
<link href="qiantai/css/style.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="qiantai/js/banner1.js">
	
</script>
<script type="text/javascript">
	function clall(Obj) {
		//获取全选，全不选的所有复选框
		var cll = document.getElementsByName("duoxuanName");
		//如果Obj被选中那么全选	

		for (var i = 0; i < cll.length; i++) {
			cll[i].checked = Obj.checked;
		}
	}

	function claii() {
		var al = document.getElementById("all");
		var als = document.getElementsByName("duoxuanName");
		for (var i = 0; i < als.length; i++) {
			if (als[i].checked == false) {
				al.checked = false;
			}
		}

	}

	function ckbuy() {
		var als = document.getElementsByName("duoxuanName");
		for (var i = 0; i < als.length; i++) {
			if (als[i].checked == true) {

				return true;
			}
		}
		alert("您还没有选您想购买的视频，请选择！");
		return false;
	}

	function ckxuan() {
		var als = document.getElementsByName("duoxuanName");
		var Array = [];
		if (ckbuy()) {
			for (var i = 0; i < als.length; i++) {
				if (als[i].checked) {
					Array.push(als[i].value);
				}
			}
			location.href = "ShowQianTaiServletYu?meet=goumai&Array=" + Array;
		}
	}
</script>
<link href="qiantai/css/single.css" type="text/css" rel="stylesheet" />
</head>

<body>
	<iframe style="width:100%;height:236px" scrolling="no" frameborder="0"
		src="qiantai/header.jsp"></iframe>
	<div class="content">

		<div class="clear"></div>
		<div class="buyDiv">

			<div class="buyHeader">
				<h1>在线视频购买</h1>
				<div class="innerDiv" onclick="history.back();">返 回</div>
				<div class="innerDiv" onclick="ckxuan();">购 买</div>
			</div>


			<div class="buyBody">

				<table class="buyTable" cellpadding="0" cellspacing="0">

					<tr>
						<th><input type="checkbox" id="all" name="dd"
							onclick="clall(this);" /></th>
						<th>课程名称</th>
						<th>课程讲师</th>
						<th>课程价格</th>
						<th>课程简介</th>
					</tr>
					<c:forEach items="${names }" var="na">
						<tr>
							<td><input type="checkbox" id="ai" name="duoxuanName"
								value="${na.couId }" onclick="claii();" /></td>
							<td><a href="ShowQianTaiServletYu?meet=courseInfo&ci=${na.couId }" target="_top" ">${na.couName }</a></td>
							<td>${na.user.useName}</td>
							<td>${na.couMoney }</td>
							<td><p>${na.couRemark}</p></td>
						</tr>
					</c:forEach>
					<c:forEach items="${sousuo}" var="ss">
						<tr>
							<td><input type="checkbox" id="ai" name="duoxuanName"
								value="${ss.couId }" onclick="claii();" /></td>
							<td>${ss.couName }</td>
							<td>${ss.user.useName}</td>
							<td>${ss.couMoney }</td>
							<td><p>${ss.couRemark}</p></td>
						</tr>
					</c:forEach>

				</table>
			</div>

			<div class="buyFoot">
				<div class="pageDiv">
				<c:if test="${page.page!=1 }">
						<a href="ShowQianTaiServletYu?meet=course&couName=${nam}&couname=${couname }&page=1&couType=0">首页</a>&nbsp;&nbsp;
						</c:if>
						<a href="ShowQianTaiServletYu?meet=course&couName=${nam}&couname=${couname }&page=${page.page -1}&couType=0">上一页</a>&nbsp;&nbsp;
						<a href="ShowQianTaiServletYu?meet=course&couName=${nam}&couname=${couname }&page=${page.page+1 }&couType=0">下一页</a>&nbsp;&nbsp;
						 <c:if test="${page.page!=page.lastPage }">
						<a href="ShowQianTaiServletYu?meet=course&couName=${nam}&couname=${couname }&page=${page.lastPage }&couType=0">尾页</a>
						</c:if>
						<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							共${page.total }条数据 &nbsp;&nbsp; 当前第&nbsp;&nbsp;${page.page }&nbsp;&nbsp;页
							共&nbsp;${page.lastPage }&nbsp;页</span>
				</div>
			</div>

		</div>
		<div class="clear"></div>
		<!--清除浮动-->
	</div>
	<!--content end-->
	<div class="footer">
		<ul>
			<li class="li_left">地址：北京海淀区成府路**号</li>
			<li class="li_right">联系电话：010-82365636</li>
		</ul>
	</div>
	<!--footer end-->
	<div style="display:none">
		<script src='http://v7.cnzz.com/stat.php?id=155540&web_id=155540'
			language='JavaScript' charset='gb2312'></script>
	</div>
</body>
</html>